<template>
	<view class="carsListPopup">
		<view class="popupTitle">车辆基本信息</view>
		<view class="content">
			<view class="totalPrice ">
				<view class="carNum">共计{{totalCarNum}}台</view>
				<view class="price">
					<view class="">合计：</view>
					<view class="priceNum">¥ {{totalPrice}}</view>
				</view>
			</view>
			<view class="infoItem" v-for="(item,index) in list" :key="index">
				<view class="infoCell">
					<view class="title">{{item.brand}} {{item.series}} {{item.model}}</view>
					<view class="data">￥{{item.price}}</view>
				</view>
				<view class="infoCell">
					<view class="title tiny ">
						<view class="icon">
							<u-icon name="https://supply.zhongyimotor.com/upload/applet/pic_car_supplier@2x.png"
								size="32"></u-icon>
						</view>
						<view class="titleContent" v-if="item.vinsList">
							<view v-for="(vin,i) in item.vinsList" :key="i">车架号：{{vin}}</view>
						</view>
						<view class="titleContent grey" v-else>
							<view>车架号：{{item.vin}}</view>
						</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		name: "carsList",
		props: {
			list: {
				type: Array,
				default: () => []
			},
			totalCarNum: {
				type: Number,
				default: 0
			},
			totalPrice: {
				type: Number,
				default: 0
			}
		},
		watch: {
			list(newLength, oldLength) {
				console.log(newLength)
			},
			totalCarNum(newValue, oldValue) {},
			totalPrice(newValue, oldValue) {},
		},
		data() {
			return {

			};
		},
		onReady() {},
		methods: {

		}
	}
</script>

<style lang="scss">
	.popupTitle {
		margin-bottom: 0;
	}

	.carsListPopup {
		padding: 40rpx;
	}

	.totalPrice {
		display: flex;
		height: 100rpx;

		line-height: 100rpx;
		background: #FFF;



		.carNum {
			font-size: 24rpx;
			font-family: PingFangSC, PingFang SC;
			font-weight: 400;
			color: #878787;
			margin-right: 20rpx;
		}

		.price {
			font-size: 24rpx;
			font-family: PingFangSC, PingFang SC;
			font-weight: 400;
			color: #202020;
			display: flex;

			.priceNum {
				font-size: 28rpx;
				font-family: DINAlternate, DINAlternate;
				font-weight: bold;
				color: #F76260;
			}
		}
	}
</style>